package com.ztf.room.service.imp;

import com.ztf.room.bean.Student;
import com.ztf.room.dao.StudentDao;
import com.ztf.room.exception.BusinessException;
import com.ztf.room.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImp implements StudentService {

    @Autowired
    private StudentDao studentDao;
    @Override
    public Student login(String account, String password) {
        Student student=  studentDao.login(account,password);
        if (student==null){
            throw new BusinessException("密码或账号错误");
        }
        return student;
    }
}
